package com.yunxi.service.localService.impl.sto;

import com.yunxi.core.service.ServiceImplPlus;
import com.yunxi.core.util.BeanTools;
import com.yunxi.dao.sto.StoStorageStaffMapper;
import com.yunxi.model.sto.StoStorageStaff;
import com.yunxi.service.localService.sto.StoStorageStaffService;
import com.yunxi.sto.pojo.StoStorageStaffUserVO;
import com.yunxi.sto.pojo.StoStorageStaffVO;
import com.yunxi.sto.pojo.StoStorageStaffWorkVO;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 仓储人员 服务实现类
 * </p>
 *
 * @author caoYong
 * @since 2019-06-06
 */
@Service
public class StoStorageStaffServiceImpl extends ServiceImplPlus<StoStorageStaffMapper, StoStorageStaff> implements StoStorageStaffService {

    /**
     * 获取仓储人员列表
     * @return
     */
    @Override
    public List<StoStorageStaffVO> staffList() {
        return baseMapper.staffList();
    }

    /**
     * 导出
     * @param stoStorageStaffVO
     * @return
     */
    @Override
    public List<StoStorageStaffVO> export(StoStorageStaffVO stoStorageStaffVO) {
        Map map = BeanTools.bean2map(stoStorageStaffVO);
        return baseMapper.queryByList(map);
    }

    @Override
    public String getUserIdByCode(String userCode) {
        return baseMapper.getUserIdByCode(userCode);
    }

    /**
     * 获取仓储人员
     * @param stoStorageStaffUserVO
     * @return
     */
    @Override
    public List<StoStorageStaffUserVO> getStaffList(StoStorageStaffUserVO stoStorageStaffUserVO) {
        return baseMapper.getStaffList(stoStorageStaffUserVO);
    }

    /**
     * 更新人员状态
     * @param stoStorageStaff
     */
    @Override
    public void updateUserStatus(StoStorageStaff stoStorageStaff) {
        baseMapper.updateUserStatus(stoStorageStaff);
    }

    @Override
    public Integer queryWorkDay(StoStorageStaffWorkVO stoStorageStaffWorkVO) {
        return baseMapper.queryWorkDay(stoStorageStaffWorkVO);
    }

    @Override
    public void delWorkDay(StoStorageStaffWorkVO stoStorageStaffWorkVO) {
        baseMapper.delWorkDay(stoStorageStaffWorkVO);
    }
}
